﻿using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Rhonin.Common.Entity;

namespace ApiManage.Models.MongoMappings
{
    /// <summary>
    /// 
    /// </summary>
    public class BaseMongoRecord : IdKey<ObjectId>
    {
        /// <summary>
        /// 
        /// </summary>
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime CreateTime => DateTime.Now;

        /// <summary>
        /// 
        /// </summary>
        public string Status { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    public class BaseFireMongoEntity : BaseMongoRecord
    {

        /// <summary>
        /// 
        /// </summary>
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? Fire { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? Expire { get; set; }
    }
}
